package com.cooge.jiexi;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.http.message.BasicHeader;

public class weibo {

	public static void main(String[] args) {
//		int i =0;
//		while(true){
//			try {
//				
//				Thread.sleep(30000);
				            //http://s.weibo.com/weibo/%25E5%25AE%2589%25E5%2585%25A8%25E8%25AF%2581%25E4%25B9%25A6?topnav=1&wvr=6&b=1
//				String url = "http://s.weibo.com/weibo/%25E5%25AE%2589%25E5%2585%25A8%25E8%25AF%2581%25E4%25B9%25A6&typeall=1&suball=1&timescope=custom:2015-06-12:2015-06-12&Refer=g";
				
				String  url = "http://s.weibo.com/weibo/%25E6%2593%2592%25E7%2588%25B1%25E8%25AE%25B0?topnav=1&wvr=6&b=1";
				
				BasicHeader bh = new BasicHeader("Cookie","SINAGLOBAL=2490913586225.361.1432537227179; wvr=6; SUS=SID-1054665974-1434002660-XD-yopqu-9acc786bbdc0809f314bb91a08db4a7e; SUE=es%3D7141034ffca7196efea8e78a12522cba%26ev%3Dv1%26es2%3D6741f8cf31d086e87f403bbfcb9fdb8f%26rs0%3DKr1BMxFFI0EWcCZnEybMfhbFwv1K52ZHfPqTpZvfRNmu4ZEPWk8Ln5y%252BUevLFZwYetYMn69IKBsstjIifEFSAfXRjALI2lcG81xfVv4qRxp1n7141sfgf21Kf6MpoBvfHAUkC6FflJL4SwjVdXRPNRfvPF5MOv1T1bpHcEoEZ50%253D%26rv%3D0; SUP=cv%3D1%26bt%3D1434002660%26et%3D1434089060%26d%3Dc909%26i%3D4a7e%26us%3D1%26vf%3D0%26vt%3D0%26ac%3D0%26st%3D0%26uid%3D1054665974%26name%3Dchuccp%2540sina.com%26nick%3Dcooge%26fmp%3D%26lcp%3D2015-01-19%252020%253A05%253A30; SUB=_2A254fVS0DeTxGedO7lYX9ivFzDiIHXVbC8F8rDV8PUNbvtAPLUjykW9WXdPUHwBDnvdlzp2np--OgC70qw..; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WW3IifBMzp5qXZA.5o-snNQ5JpX5KMt; SUHB=0P195IlsqaHtzo; ALF=1465538660; SSOLoginState=1434002660; _s_tentry=weibo.com; Apache=4250632259063.423.1434002670681; ULV=1434002670763:39:24:10:4250632259063.423.1434002670681:1433992206993; UOR=,,login.sina.com.cn");
				try {
					String html = NetUtil.getHtml(url,bh);
					
					
					
					int start = html.lastIndexOf("\\u9875<\\/a><\\/li><\\/ul><\\/div>");
					
					if(start!=-1){
						html = html.substring(0,start);
						start = html.lastIndexOf("\\u7b2c")+"\\u7b2c".length();
						
						html = html.substring(start, html.length());
						System.out.println(html);
					}
					
					
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
//				int start = html.indexOf("<span>\\u627e\\u5230");
//				if(start>0){
//					html = html.substring(start+"<span>\\u627e\\u5230".length());
//					html = html.substring(0, html.indexOf("\\u6761\\u7ed3\\u679c\\uff0c"));
//					System.out.println(html);
//				}else{
//					System.out.println(0);
//				}
//				
//			} catch (Exception e) {
//				e.printStackTrace();
//			}
//			System.out.println(i);
//			i++;
//		}
//		
//		SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
//		
//		String time =  format.format(new Date());
//		
//		System.out.println(time);

	}

}
